summaryrefslogtreecommitdiffstats
path: root/src/app/(protected)/offices/[officeId].tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/(protected)/offices/[officeId].tsx')
-rw-r--r--src/app/(protected)/offices/[officeId].tsx198
1 files changed, 103 insertions, 95 deletions
diff --git a/src/app/(protected)/offices/[officeId].tsx b/src/app/(protected)/offices/[officeId].tsx
index 91e6905..16a60cf 100644
--- a/src/app/(protected)/offices/[officeId].tsx
+++ b/src/app/(protected)/offices/[officeId].tsx
@@ -48,14 +48,14 @@ export default function OfficeDetailScreen() {
return (
<View style={styles.center}>
<Text style={{ color: theme.colors.error }}>
- {error ?? 'No se pudo cargar el espacio'}
+ {error ?? "No se pudo cargar el espacio"}
</Text>
<Pressable style={styles.primaryButton} onPress={reload}>
<Text style={styles.primaryButtonText}>Reintentar</Text>
</Pressable>
- <Link href="/offices" asChild>
+ <Link href="/(protected)/(tabs)/offices" asChild>
<Pressable style={styles.secondaryButton}>
<Text style={styles.primaryButtonText}>Volver</Text>
</Pressable>
@@ -68,62 +68,53 @@ export default function OfficeDetailScreen() {
const isAvailable = office.available ?? true;
return (
- <ScrollView contentContainerStyle={styles.container}>
- <View style={styles.content}>
- {/* HEADER */}
- <Link href="/offices" asChild>
- <Pressable>
- <Text style={styles.back}>← Volver a espacios</Text>
- </Pressable>
- </Link>
+ <View style={styles.container}>
+ {/* cabecera superior */}
+ <View style={styles.topBar}>
+ <View style={styles.topBarContent}>
+ <Link href="/(protected)/(tabs)/offices" asChild>
+ <Pressable>
+ <Text style={styles.topBarBack}>← Volver a espacios</Text>
+ </Pressable>
+ </Link>
+ </View>
+ </View>
+ <ScrollView
+ style={styles.scroll}
+ contentContainerStyle={styles.content}
+ showsVerticalScrollIndicator={false}
+ >
{/* IMAGE */}
- {/*<View style={styles.imageBox}>
- <Text style={styles.imageIcon}>🏢</Text>
- </View>*/}
-<View style={styles.imageBox}>
- <MaterialIcons
- name="business"
- size={80}
- color={theme.colors.primary}
- />
-</View>
+ <View style={styles.imageBox}>
+ <MaterialIcons
+ name="business"
+ size={80}
+ color={theme.colors.primary}
+ />
+ </View>
{/* TITLE */}
<View style={styles.titleRow}>
- <View style={{ flex: 1 }}>
+ <View style={styles.titleBlock}>
<Text style={styles.title}>{office.name}</Text>
<Text style={styles.subtitle}>
- {office.location ?? 'Sin ubicación'}
+ {office.location ?? "Sin ubicación"}
</Text>
</View>
- <View
- style={[
- styles.badge,
- isAvailable && styles.badgeActive,
- ]}
- >
+ <View style={[styles.badge, isAvailable && styles.badgeActive]}>
<Text
- style={[
- styles.badgeText,
- isAvailable && styles.badgeTextActive,
- ]}
+ style={[styles.badgeText, isAvailable && styles.badgeTextActive]}
>
- {isAvailable ? 'Disponible' : 'Ocupado'}
+ {isAvailable ? "Disponible" : "Ocupado"}
</Text>
</View>
</View>
- {/* CAPACITY + PRICE */}
+ {/* CAPACITY */}
<View style={styles.metaRow}>
- <Text style={styles.meta}>
- {office.capacity} personas
- </Text>
-
- {/* <Text style={styles.price}>
- {office.price ?? '—'}
- </Text>*/}
+ <Text style={styles.meta}>{office.capacity} personas</Text>
</View>
{/* DESCRIPTION */}
@@ -148,6 +139,7 @@ export default function OfficeDetailScreen() {
value={selectedDate}
onChangeText={setSelectedDate}
placeholder="YYYY-MM-DD"
+ placeholderTextColor={theme.colors.textSecondary}
keyboardType="number-pad"
maxLength={10}
/>
@@ -177,9 +169,7 @@ export default function OfficeDetailScreen() {
<Text style={styles.occupiedTime}>
{reservation.startTime} - {reservation.endTime}
</Text>
- <Text style={styles.occupiedText}>
- Ocupado
- </Text>
+ <Text style={styles.occupiedText}>Ocupado</Text>
</View>
))}
</View>
@@ -193,26 +183,23 @@ export default function OfficeDetailScreen() {
{/* FAVORITE */}
<Pressable
- style={[
- styles.favoriteButton,
- isFav && styles.favoriteButtonActive,
- ]}
+ style={[styles.favoriteButton, isFav && styles.favoriteButtonActive]}
onPress={() => toggleFavorite(office.id)}
disabled={pendingOfficeId === office.id}
>
<Text style={styles.favoriteText}>
{pendingOfficeId === office.id
- ? '...'
+ ? "..."
: isFav
- ? '★ Guardado'
- : '☆ Guardar como favorito'}
+ ? "★ Guardado"
+ : "☆ Guardar como favorito"}
</Text>
</Pressable>
{/* RESERVE BUTTON */}
<Link
href={{
- pathname: '/(protected)/reservations/create',
+ pathname: "/(protected)/reservations/create",
params: {
officeId: office.id,
officeName: office.name,
@@ -221,62 +208,89 @@ export default function OfficeDetailScreen() {
asChild
>
<Pressable style={styles.reserveButton}>
- <Text style={styles.reserveText}>
- Reservar ahora
- </Text>
+ <Text style={styles.reserveText}>Reservar ahora</Text>
</Pressable>
</Link>
- </View>
- </ScrollView>
+ </ScrollView>
+ </View>
);
}
const styles = StyleSheet.create({
container: {
- paddingVertical: theme.spacing.xl,
+ flex: 1,
+ backgroundColor: theme.colors.background,
+ },
+
+ // cabecera superior con el mismo patron que reservas
+ topBar: {
+ backgroundColor: theme.colors.surface,
+ borderBottomWidth: 1,
+ borderBottomColor: theme.colors.border,
+ paddingHorizontal: theme.spacing.xl,
+ paddingTop: theme.spacing.xxxl,
+ paddingBottom: theme.spacing.lg,
+ },
+
+ // contenido centrado de la cabecera
+ topBarContent: {
+ maxWidth: theme.layout.contentWidth,
+ width: "100%",
+ alignSelf: "center",
+ },
+
+ // texto para volver al listado
+ topBarBack: {
+ color: theme.colors.textSecondary,
+ fontSize: theme.typography.md,
+ },
+
+ // scroll principal
+ scroll: {
+ flex: 1,
+ backgroundColor: theme.colors.background,
},
+ // contenido interno del scroll
content: {
- width: '100%',
+ width: "100%",
maxWidth: theme.layout.contentWidth,
- alignSelf: 'center',
+ alignSelf: "center",
paddingHorizontal: theme.spacing.xl,
+ paddingTop: theme.spacing.lg,
+ paddingBottom: theme.spacing.xxxl,
gap: theme.spacing.xl,
},
center: {
flex: 1,
- justifyContent: 'center',
- alignItems: 'center',
+ justifyContent: "center",
+ alignItems: "center",
padding: theme.spacing.xl,
gap: theme.spacing.md,
- },
-
- back: {
- color: theme.colors.textSecondary,
- fontSize: theme.typography.md,
+ backgroundColor: theme.colors.background,
},
imageBox: {
- width: '100%',
+ width: "100%",
height: 180,
borderRadius: theme.radius.xl,
backgroundColor: theme.colors.primarySoft,
- alignItems: 'center',
- justifyContent: 'center',
- },
-
- imageIcon: {
- fontSize: 48,
+ alignItems: "center",
+ justifyContent: "center",
},
titleRow: {
- flexDirection: 'row',
- justifyContent: 'space-between',
- alignItems: 'flex-start',
+ flexDirection: "row",
+ justifyContent: "space-between",
+ alignItems: "flex-start",
gap: theme.spacing.md,
},
+ titleBlock: {
+ flex: 1,
+ },
+
title: {
fontSize: theme.typography.xxxl,
fontWeight: theme.fontWeight.semibold,
@@ -289,34 +303,28 @@ const styles = StyleSheet.create({
},
metaRow: {
- flexDirection: 'row',
- justifyContent: 'space-between',
- alignItems: 'center',
+ flexDirection: "row",
+ justifyContent: "space-between",
+ alignItems: "center",
},
meta: {
color: theme.colors.textSecondary,
},
- price: {
- color: theme.colors.primary,
- fontSize: theme.typography.xxl,
- fontWeight: theme.fontWeight.semibold,
- },
-
card: {
backgroundColor: theme.colors.surface,
- borderRadius: theme.radius.lg,
+ borderRadius: theme.radius.xxl,
padding: theme.spacing.lg,
borderWidth: 1,
borderColor: theme.colors.border,
+ gap: theme.spacing.md,
...theme.shadows.card,
},
sectionTitle: {
- fontSize: theme.typography.lg,
+ fontSize: theme.typography.xl,
fontWeight: theme.fontWeight.semibold,
- marginBottom: theme.spacing.sm,
color: theme.colors.text,
},
@@ -347,8 +355,8 @@ const styles = StyleSheet.create({
inlineState: {
marginTop: theme.spacing.md,
- flexDirection: 'row',
- alignItems: 'center',
+ flexDirection: "row",
+ alignItems: "center",
gap: theme.spacing.sm,
},
@@ -418,11 +426,11 @@ const styles = StyleSheet.create({
padding: theme.spacing.md,
borderRadius: theme.radius.md,
backgroundColor: theme.colors.divider,
- alignItems: 'center',
+ alignItems: "center",
},
favoriteButtonActive: {
- backgroundColor: '#ffe8a3',
+ backgroundColor: "#ffe8a3",
},
favoriteText: {
@@ -434,7 +442,7 @@ const styles = StyleSheet.create({
backgroundColor: theme.colors.primary,
paddingVertical: theme.spacing.lg,
borderRadius: theme.radius.lg,
- alignItems: 'center',
+ alignItems: "center",
},
reserveText: {
@@ -459,4 +467,4 @@ const styles = StyleSheet.create({
padding: theme.spacing.md,
borderRadius: theme.radius.md,
},
-});
+}); \ No newline at end of file